package com.zengqingfa.springboot.redis.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zengqingfa.springboot.redis.entity.User;

import java.util.List;

/**
 * @Author: slfx
 * @Date: 2022-07-27
 * @Description:
 **/
public interface UserService extends IService<User> {

    /**
     * 根据Id查询
     *
     * @param id
     * @return
     */
    User getById(Long id);

    /**
     * 批量查询
     * @param bean
     * @return
     */
    List<User> listUser(User bean);

    /**
     * 分页查询
     */
    IPage<User> listUserByPage(Page<User> page, User bean,String userId);

    /**
     * 新增
     * @param bean
     * @return Integer
     */
    Integer add(User bean);

    /**
     * 根据id修改
     * @param bean
     * @return Boolean
     */
    Boolean modifyById(User bean);

    /**
     * 根据id删除
     * @param id
     * @return Boolean
     */
    Boolean deleteById(Integer id);

    List<String> getSearchUserNameHistory(String currentUserId);

    List<User> getSearchUserHistory(String currentUserId);

    /**
     * 批量更新
     * @param users
     * @return
     */
    Boolean batchUpdateByIds(List<User> users);
}
